import requests


def message_send(msg: str, title: str, feishu_url: str):
    # feishu_url = "https://open.feishu.cn/open-apis/bot/v2/hook/99ee7127-71d1-4f4f-a532-e81704d0e72e"
    if "/v2/" in feishu_url:
        data = {
            "msg_type": "post",
            "content": {
                "post": {
                    "zh_cn": {
                        "title": title,
                        "content": [[{"tag": "text", "text": msg}]],
                    }
                }
            },
        }
    r = requests.post(url=feishu_url, json=data)

if __name__ == "__main__":
    message_send(
        msg = "测试信息",
        title = "测试",
        feishu_url="https://open.feishu.cn/open-apis/bot/v2/hook/99ee7127-71d1-4f4f-a532-e81704d0e72e",
    )
